<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>幻灯片</title>
    <!-- 最新版本的 Bootstrap 核心 CSS 文件 -->
    <script src="/lib/jquery/1.9.1/jquery.js"></script>
    <link rel="stylesheet" href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
    <!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
    <script src="https://cdn.bootcss.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
    <script src="/H-ui.admin/lib/layer/2.4/layer.js"></script>
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
</head>
<body>
<div class="container-fluid" style="margin: 20px 50px">
    <form class="col-md-12"action="{:url('search')}" method="post">
        <div class="col-md-12" style="float:right">
                <div class="col-md-4">
                    <div class="input-group">
                        <input type="text" class="form-control"  name="store" placeholder="">
                        <span class="input-group-btn">
                            <button type="button" class="btn btn-primary store">
                                <span class="glyphicon glyphicon-plus"></span>
                                选择商家</button>
                        </span>
                    </div>
                </div>
                <div class="col-md-4">
                    <div class="input-group">
                        <input type="text" class="form-control"  name="user" placeholder="">
                        <span class="input-group-btn">
                            <button type="button" class="btn btn-primary user">
                                <span class="glyphicon glyphicon-plus"></span>
                                选择用户</button>
                        </span>
                    </div>
                </div>
                <div class="col-md-3">
                    <div class="input-group">
                        <span class="input-group-addon">订单ID&emsp;</span>
                        <input type="text" class="form-control"  name="content" placeholder="">
                    </div>
                </div>
            <button type="submit" class="btn btn-default col-sm-1"><span class="glyphicon glyphicon-search" aria-hidden="true"></span>搜索</button>
        </div>
    </form>

</div>


<div style="margin: 10px 50px">
    <table class="table table-hover" style="width:100%">
        <tr>
            <th>订单ID</th>
            <th>农居名称</th>
            <th>农居图片</th>
            <th>租赁方式</th>
            <th>入驻人数</th>
            <th>支付订金</th>
            <th>房屋月租</th>
            <th>短租总价</th>
            <th>入住人员</th>
            <th>预订时间</th>
            <th>订单状态</th>
            <th>支付方式</th>
            <th>下单时间</th>
            <th>身份证</th>
            <th>操作</th>
        </tr>
        {foreach $items as $value}
        <tr>
            <td>{$value.id}</td>
            <td>{$value.house_name}</td>
            <td>
                <img src="{$value.house_image}" class="img-responsive img-thumbnail" style="width: 100px"/>
            </td>
            <td>{$value.renting_style}</td>
            <td>{$value.house.residents}</td>
            {if condition="$value.renting_style"}
            <td>{$value.house.long_price}</td>
            <td>{$value.house.pay_price}</td>
            <td>无</td>
            {else}
            <td>无</td>
            <td>无</td>
            <td>{$value.house.short_price}</td>
            {/if}
            <td>
                <p>{$value.user.rname}</p>
                <p>{$value.user.mobile}</p>
            </td>
            <td>

            </td>
            <td>
                {switch $value.order_status}
                {case 0}取消{/case}
                {case 1}待支付{/case}
                {case 2}已支付{/case}
                {case 3}已完成{/case}
                {case 4}退款{/case}
                {/switch}
            </td>
            <td>
                {switch $value.pay_status}
                {case 0}未支付{/case}
                {case 1}支付宝{/case}
                {case 2}微信{/case}
                {case 3}钱包支付{/case}
                {/switch}
            </td>
            <td>{$value.createtime}</td>
            <td>{$value.user.certificate}</td>
            <td>
                <a href="{:url('cancel')}?id={$value.id}" class="btn btn-primary btn-xs">取消订单</a>
                <a href="{:url('checkIn')}?id={$value.id}" class="btn btn-primary btn-xs">入住</a>
                <a href="{:url('del')}?id={$value.id}" class="btn btn-primary btn-xs">删除订单</a>
            </td>
        </tr>
        {/foreach}
    </table>
    <div style="">{php}echo $page{/php}</div>
</div>


</body>
<script>
    //iframe窗
    function open(obj){
        //iframe层

        var index=layer.open({
            type: 2,
            title: obj.title,
            shadeClose: false,
            shade: 0.3,
            area: ['80%', '80%'],
            content: obj.url, //iframe的url
            end:obj.end
        });
        return index;
    }


    $(".store").on("click",function (e) {
        var index=open({
            url:"{:url('chooseStore')}",
            title:"选择商家",
            end:function () {
                var name=layer.getChildFrame($("input[type='radio']:checked"),index);
                console.log(name);
            }
        });
    });

    $(".user").on("click",function (e) {
        var index=open({
            url:"{:url('chooseUser')}",
            title:"选择用户",
            end:function () {

            }
        });
    })
</script>
</html>